Custom Driver Model Generation from versioned Schema#24
Merged
PaulWinterstein merged 12 commits intoMay 20, 2025
Merged
Conversation
…revent import errors. Necessary for downgrade support.
PaulWinterstein
approved these changes
May 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new VS Code task
Generate Driver Modelsthat takes a driver schema JSON file (default is the latest one) and generates the pydantic data model based on it.Since the overloads should be generated after this too, I adjusted the tasks for this as well. There is now a task
Generate Data Modelthat just runs all related code generations in the right order. So this is the task one should use when generating the model for a new version.I also looked that the docstrings render as good as possible - looks a bit ugly in the code, but if the docstring is indented, it is indented in the preview / documentation too.
The only thing I didn't do (yet) is documentation - this should probably documented in the Readme and at least the
PydanticModelBuildershould have some docstrings at least. But I wanted to get feedback first before investing time in it